package com.zhuxiang.test2;

/**
 * 定义上网套餐类
 */
public class InterPlan extends PhonePlans implements InterService {
    //上网流量
    private int flow;

    public InterPlan(int flow) {
        super();
        this.flow = flow;
    }

    public int getFlow() {
        return flow;
    }

    public void setFlow(int flow) {
        this.flow = flow;
    }

    /**
     * 显示上网套餐的信息
     */
    @Override
    public void show(){
        System.out.println("上网流量："+getFlow()+"MB,每月资费："+getRate()+"元");
    }

    /**
     * 重写上网服务里的方法
     * @param flow
     * @param type
     * @return
     */
    @Override
    public int inter(int flow, String type) {
        System.out.println("剩余套餐流量："+(getFlow()-flow)+"MB，手机卡类型："+ type);
        return flow;
    }
}
